if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_GetAuthorByEmail]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_GetAuthorByEmail]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO

CREATE PROCEDURE sp_GetAuthorByEmail
@Email varchar
AS
if (exists(Select AuthorID from Author where Email = @Email))
begin
select AuthorID
from Author
where  Email = @Email
end
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

